package com.consumer.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @Author kuang
 * @Date 2021/8/8 21:33
 */
@RequestMapping(value = "/consumer")
@RestController
public class ConsulController {

    public static final String INVOKE_URL = "http://payment8906";

    @Resource
    private RestTemplate restTemplate;

    @GetMapping(value = "/consul")
    public String getConsulPayment() {
        return restTemplate.getForObject(INVOKE_URL + "/payment/consul", String.class);
    }
}
